/*
 * this header file defines the SingleFile class extends ModularAtomic
 */

#ifndef __CCCC_MOD_SINFILE_H
#define __CCCC_MOD_SINFILE_H

#include "cccc_mod_atom.h"
#include <iostream>

class Func;

class SingleFile: public ModularAtomic
{
public:
	SingleFile();
	SingleFile(string filename);
	~SingleFile();

	virtual void setFanins()
	{

	}
	virtual void setFanouts()
	{

	}

	void setFilename(string _filename);
	string getFilename();
	void setFile(FILE * _file);
	FILE * getFile();
	void setCOMPONENT(string component);
	string getCOMPONENT();
	void setMODULE(string module);
	string getMODULE();
	void setSUBMODULE(string submodule);
	string getSUBMODULE();
	void setNumFunc(int numFunc);
	int getNumFunc();
	void setIncludes(vector<string> * in);
	vector<string> * getIncludes();
	void printIncludes();
	void setLOC(int loc);
	int getLOC()
	{
		return LOC;
	}
	void setVISIBILITY(string vis);
	string getVISIBILITY();
	void setMODULE_DEF_LINE(int line);
	int getMODULE_DEF_LINE();

	void setSUBMODULE_DEF_LINE(int line);
	int getSUBMODULE_DEF_LINE();

	void setIncludeLineVec(vector<int> * include_line);
	vector<int> * getIncldueLineVec();
    vector<Func> *getFuncs() const
    {
        return funcs;
    }

    void setFuncs(vector<Func> *funcs)
    {
        this->funcs = funcs;
    }

    bool getIsNoneDefault() const
    {
        return isNoneDefault;
    }

    void setIsNoneDefault(bool isNoneDefault)
    {
        this->isNoneDefault = isNoneDefault;
    }

    int getCodeLineNum() const
    {
        return codeLineNum;
    }

    int getCommLineNum() const
    {
        return commLineNum;
    }

    int getSpeIfdefNum() const
    {
        return speIfdefNum;
    }

    void setCodeLineNum(int codeLineNum)
    {
        this->codeLineNum = codeLineNum;
    }

    void setCommLineNum(int commLineNum)
    {
        this->commLineNum = commLineNum;
    }

    void setSpeIfdefNum(int sepIfdefNum)
    {
        this->speIfdefNum = sepIfdefNum;
    }

private:
	string filename;
	FILE * file;
	string COMPONENT;
	string MODULE;
	string SUBMODULE;
	int NUM_FUNCS;
	vector<string> * includes;
	vector<int> * include_line;
	int LOC;
	string VISIBILITY;
	int MODULE_DEF_LINE;
	int SUBMODULE_DEF_LINE;

	int codeLineNum;
	int commLineNum;
	int speIfdefNum;

	bool isNoneDefault;
	vector<Func>* funcs;

};

class Func{
private:
	string name;
	int startLine;
	int mvg;
public:
	Func(){
		startLine=-1;
		mvg=-1;
	}

    int getMvg() const
    {
        return mvg;
    }

    string getName() const
    {
        return name;
    }

    void setMvg(int mvg)
    {
        this->mvg = mvg;
    }

    void setName(string name)
    {
        this->name = name;
    }

    int getStartLine() const
    {
        return startLine;
    }

    void setStartLine(int startLine)
    {
        this->startLine = startLine;
    }

    void printFunc(){
    	cout<<"Func Name : "<<this->name<<endl;
    	cout<<"Func StartLine : "<<this->startLine<<endl;
    	cout<<"Func MVG : "<<this->mvg<<endl;
    }

};

#endif
